package com.prs.crm.domain.assets;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.BaseEntity;
/**
 * @author 廖苹宏
 * @version 2012-6-4 17:26:56 资产登记
 * */
@Entity
@Table(name="ass_assetsregister")
public class AssetsRegister extends BaseEntity{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;
	/**资产名称*/
	private String name;  
	/**资产编号*/
	private String num;   
	/**资产状态*/
	private String state;
	/**规格*/
	private String guige;
	/**采购人*/            
	private String caigou;
	/**折旧年限*/            
	private int zjnx;
	/**残值率*/            
	@Column(columnDefinition = "Double(11,2) default '0.00'")
	private double canzhi;
	/**发票日期*/            
	private Date fprq;
	/**发票金额*/      
	@Column(columnDefinition = "Double(11,2) default '0.00'")
	private double fpje;
	/**资产残值*/   
	@Column(columnDefinition = "Double(11,2) default '0.00'")
	private double zccz;
	/**资产净值*/  
	@Column(columnDefinition = "Double(11,2) default '0.00'")
	private double zcjz;
	/**凭证号*/            
	private String pznum;
	/**折旧开始年月*/            
	private String zjstart;
	/**当前折旧年月*/            
	private String zjnow;
	/**已折旧月数*/            
	private int zjmonth;
	/**备注*/            
	private String remark;
	/**所属大类*/
	@ManyToOne
	private AssetsBigClass assetsBigClass;
	/**所属小类*/
	@ManyToOne
	private AssetsSmallClass assetsSmallClass;
	/**资产明细*/
	@OneToMany(cascade={CascadeType.ALL})
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Set<AssetsDetail> assetsDetails;
	/**资产领用*/
	@ManyToOne(cascade={CascadeType.ALL})
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private AssetsLingYong assetsLingYong;
	/**资产归还*/
	@ManyToOne(cascade={CascadeType.ALL})
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private AssetsRevert asssteRevert;
	/**资产报废*/
	@ManyToOne(cascade={CascadeType.ALL})
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private AssetsScrap assetsScrap;
	/**资产说明*/
	private String shuoming; 
	
	/**是否折旧*/
	private Boolean isZJ;
	/**本月折旧值*/
	@Column(columnDefinition = "Double(11,2) default '0.00'")
	private double zjCurrentMonth;
	/**本月残值*/
	@Column(columnDefinition = "Double(11,2) default '0.00'")
	private double czMinth;
	/**操作类型*/
	private String operateType;
	/**操作人*/
	private String operatePerson;
	/**已折旧总值*/
	private double zjAll;

	public double getCanzhi() {
		return canzhi;
	}
	public void setCanzhi(double canzhi) {
		this.canzhi = canzhi;
	}
	public double getFpje() {
		return fpje;
	}
	public void setFpje(double fpje) {
		this.fpje = fpje;
	}
	public double getZccz() {
		return zccz;
	}
	public void setZccz(double zccz) {
		this.zccz = zccz;
	}
	public double getZcjz() {
		return zcjz;
	}
	public void setZcjz(double zcjz) {
		this.zcjz = zcjz;
	}
	public double getZjCurrentMonth() {
		return zjCurrentMonth;
	}
	public void setZjCurrentMonth(double zjCurrentMonth) {
		this.zjCurrentMonth = zjCurrentMonth;
	}
	public double getCzMinth() {
		return czMinth;
	}
	public void setCzMinth(double czMinth) {
		this.czMinth = czMinth;
	}
	public double getZjAll() {
		return zjAll;
	}
	public void setZjAll(double zjAll) {
		this.zjAll = zjAll;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public Boolean getIsZJ() {
		return isZJ;
	}
	public void setIsZJ(Boolean isZJ) {
		this.isZJ = isZJ;
	}

	public String getOperateType() {
		return operateType;
	}
	public void setOperateType(String operateType) {
		this.operateType = operateType;
	}
	public String getOperatePerson() {
		return operatePerson;
	}
	public void setOperatePerson(String operatePerson) {
		this.operatePerson = operatePerson;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNum() {
		return num;
	}
	public void setNum(String num) {
		this.num = num;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getGuige() {
		return guige;
	}
	public void setGuige(String guige) {
		this.guige = guige;
	}
	public String getCaigou() {
		return caigou;
	}
	public void setCaigou(String caigou) {
		this.caigou = caigou;
	}

	public int getZjnx() {
		return zjnx;
	}
	public void setZjnx(int zjnx) {
		this.zjnx = zjnx;
	}
	public Date getFprq() {
		return fprq;
	}
	public void setFprq(Date fprq) {
		this.fprq = fprq;
	}
	public String getPznum() {
		return pznum;
	}
	public void setPznum(String pznum) {
		this.pznum = pznum;
	}
	public String getZjstart() {
		return zjstart;
	}
	public void setZjstart(String zjstart) {
		this.zjstart = zjstart;
	}
	public String getZjnow() {
		return zjnow;
	}
	public void setZjnow(String zjnow) {
		this.zjnow = zjnow;
	}
	public int getZjmonth() {
		return zjmonth;
	}
	public void setZjmonth(int zjmonth) {
		this.zjmonth = zjmonth;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public AssetsBigClass getAssetsBigClass() {
		return assetsBigClass;
	}
	public void setAssetsBigClass(AssetsBigClass assetsBigClass) {
		this.assetsBigClass = assetsBigClass;
	}
	public AssetsSmallClass getAssetsSmallClass() {
		return assetsSmallClass;
	}
	public void setAssetsSmallClass(AssetsSmallClass assetsSmallClass) {
		this.assetsSmallClass = assetsSmallClass;
	}
	public Set<AssetsDetail> getAssetsDetails() {
		return assetsDetails;
	}
	public void setAssetsDetails(Set<AssetsDetail> assetsDetails) {
		this.assetsDetails = assetsDetails;
	}
	public AssetsLingYong getAssetsLingYong() {
		return assetsLingYong;
	}
	public void setAssetsLingYong(AssetsLingYong assetsLingYong) {
		this.assetsLingYong = assetsLingYong;
	}
	public AssetsRevert getAsssteRevert() {
		return asssteRevert;
	}
	public void setAsssteRevert(AssetsRevert asssteRevert) {
		this.asssteRevert = asssteRevert;
	}
	public String getShuoming() {
		return shuoming;
	}
	public void setShuoming(String shuoming) {
		this.shuoming = shuoming;
	}
	public AssetsScrap getAssetsScrap() {
		return assetsScrap;
	}
	public void setAssetsScrap(AssetsScrap assetsScrap) {
		this.assetsScrap = assetsScrap;
	}
	
}
